package com.hsb.seckill.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hsb.seckill.entity.Order;
import com.hsb.seckill.entity.User;
import com.hsb.seckill.vo.GoodsVo;
import com.hsb.seckill.vo.OrderDetailVo;

/**
 * (Order)表服务接口
 *
 * @author makejava
 * @since 2021-09-05 21:58:25
 */
public interface OrderService extends IService<Order> {

    /**
     * 秒杀，创建订单
     * @param user
     * @param goods
     * @return
     */
    Order sekill(User user, GoodsVo goods);

    /**
     * 根据订单id查询订单详情
     * @param orderId
     * @return
     */
    OrderDetailVo detail(Long orderId);

    /**
     * 获取秒杀地址
     * @param user
     * @param goodsId
     * @return
     */
    String getPath(User user, Long goodsId);

    /**
     * 校验秒杀路径是否合法
     * @param user
     * @param goodsId
     * @return
     */
    Boolean checkPath(User user, long goodsId,String path);

    /**
     * 校验验证码
     * @param user
     * @param goodsId
     * @param captcha
     * @return
     */
    Boolean checkCaptcha(User user, Long goodsId, String captcha);
}